package org.example.myleet.p1342;

public class Solution {
    public int numberOfSteps(int num) {
        int result = 0;
        while (num > 0) {
            if ((num & 1) == 1) {
                --num;
            } else {
                num = num >>> 1;
            }
            ++result;
        }
        return result;
    }
}
